﻿#ifndef __COMMON_H__
#define __COMMON_H__
#include "cocos2d.h"
#include "CocosGUI.h"
#include "SimpleAudioEngine.h"
#include "System/GameData.h"
#include "Utility/Utility.h"

#include <list>
#include <vector>
#include <set>
#include <map>

#include <stdio.h>
#include <stdarg.h>

USING_NS_CC;

#ifndef FALSE
	#define FALSE	false
#endif
#ifndef TRUE
	#define TRUE true
#endif

#ifndef NULL
#define NULL 0
#endif

	template<typename T>
	inline std::string GetString(const T n)
	{
		std::stringstream str;
		str << n;
		return str.str();
	}

	template<typename T>
	inline std::wstring GetWString(const T n)
	{
		std::wstringstream str;
		str << n;
		return str.str();
	}

	int replace_string(std::string& str,  const std::string& pattern,  const std::string& newpat);
	inline std::wstring GetWString(char *in_Src)
	{
		wchar_t buffer[1024];
		swprintf(buffer, 1024, L"%hs", in_Src);

		return std::wstring(buffer);
	}
	class Screen
	{
	public:
		static CCSize GetScreenSize(){ return CCSize(640,960); }
	};

	
	extern ccColor3B GetRGB(unsigned int rgba);


#define  MAX_COLOR_SLOT  8
#define  MAX_COLOR_TBL_SLOT  4
#define  MAX_LIFE	5
#endif
